<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('订单列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
<!--            <div class="col-sm-12 search-collapse">-->
<!--                <form id="formId">-->
<!--                    <div class="select-list">-->
<!--                        <ul>-->
<!--                            <li>-->
<!--                                <label>ISBN：</label>-->
<!--                                <input type="text" name="isbn"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>书名：</label>-->
<!--                                <input type="text" name="name"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>作者：</label>-->
<!--                                <input type="text" name="author"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>出版社：</label>-->
<!--                                <input type="text" name="publisher"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>出版日期：</label>-->
<!--                                <input type="text" class="time-input" placeholder="请选择出版日期" name="publishDate"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>原价：</label>-->
<!--                                <input type="text" name="oldPrice"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>现价：</label>-->
<!--                                <input type="text" name="newPrice"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>出版地：</label>-->
<!--                                <input type="text" name="authorLoc"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>是否套装：</label>-->
<!--                                <select name="suit" th:with="type=${@dict.getType('sys_book_suit')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>图书类别：</label>-->
<!--                                <select name="category" th:with="type=${@dict.getType('sys_book_category')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--&lt;!&ndash;                            <li>&ndash;&gt;-->
<!--&lt;!&ndash;                                <label>分类名称：</label>&ndash;&gt;-->
<!--&lt;!&ndash;                                <input type="text" name="fenleiName"/>&ndash;&gt;-->
<!--&lt;!&ndash;                            </li>&ndash;&gt;-->
<!--                            <li>-->
<!--                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
<!--                            </li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                </form>-->
<!--            </div>-->

<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:book:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:book:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:book:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:book:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
<!--            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">

        var statusDatas = [[${@dict.getType('sys_order_status')}]];

        var prefix = ctx + "business/order";



        $(function() {
            var options = {
                url: prefix + "/list",
                updateUrl: prefix + "/submit/{id}",
                detailUrl: prefix + "/query/{id}",
                modalName: "订单",
                columns: [{
                    checkbox: true,
                    visible: false
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'createDate',
                    title: '创建时间'
                },
                {
                    field: 'orderNum',
                    title: '订单编号'
                },
                {
                    field: 'user.username',
                    title: '用户名'
                },
                    {
                        field: 'user.phone',
                        title: '联系电话'
                    },
                    {
                        field: 'address.province',
                        title: '收货地址'
                    },

                    {
                        field: 'orderItems.book.name',
                        title: '书名'
                    },
                    {
                        field: 'orderStatus',
                        title: '订单状态',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(statusDatas, value);
                        }
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
                            // actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>发货</a> ');
                            return actions.join('');
                        }
                    }

               ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>